// 封装用户接口

import request from '@/utils/request'

// 获取用户信息
export const getUserInfoAPI = () => {
  return request.get('/my/userinfo')
}

// 修改个人信息
export const updateUserInfoAPI = ({ id, nickname, email }) => {
  return request.put('/my/userinfo', { id, nickname, email })
}

// 修改头像
export const userUploadAvatarService = (avatar) =>
  request.patch('/my/update/avatar', { avatar })

// 修改密码
export const userUpdatePassService = ({ old_pwd, new_pwd, re_pwd }) =>
  request.patch('/my/updatepwd', { old_pwd, new_pwd, re_pwd })
